/*
 * Copyright (c) 2020-2099 the original author or authors. All rights reserve.
 */
package org.tianyun.cloud.config.refresh.smart;

import org.springframework.context.ApplicationEvent;

import java.util.Set;

/**
 * 刷新事件
 * <p>
 *
 * @author ebert_chan
 * @date 2024/4/2
 */
public class SmartScopeRefreshedEvent extends ApplicationEvent {

    public SmartScopeRefreshedEvent(Set<String> refreshedKeys) {
        super(refreshedKeys);
    }

    @SuppressWarnings("unchecked")
    public Set<String> getRefreshedKeys() {
        return (Set<String>) super.getSource();
    }

    public boolean isRefreshedKey(String prefix) {
        return getRefreshedKeys().contains(prefix);
    }

}
